# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
_pkgname=geopy
pkgname="py3-$_pkgname"
pkgver=2.4.0
pkgrel=0
pkgdesc="Geocoding library"
url="https://geopy.readthedocs.io/"
arch="noarch"
license="MIT"
depends="
	py3-geographiclib
	"
makedepends="
	py3-gpep517
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="
	py3-async_generator
	py3-aiohttp
	py3-pytest
	py3-pytest-aiohttp
	py3-pytest-asyncio
	py3-pytest-xdist
	py3-sphinx
	"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/g/geopy/geopy-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto -v \
		--ignore='test/geocoders' \
		--deselect=test/adapters/each_adapter.py # timeout read internet
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
4856440956a334e3fe653af0001b75e9eb0d3216059f8caca11fd3bb8ebd2933a1219baeae15563d0142609226559d8fefec44222d924c957d9b593e4ce66a18  geopy-2.4.0.tar.gz
"
